<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<div class="t_bar2">使用维护人员情况</div>
	<table  id="awardInfo" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center"  width="5%;">选择</th>
						<th class="TblHead" align="center"  width="5%;">序号</th>
						<th class="TblHead" align="center"  width="10%;">姓名</th>
						<th class="TblHead" align="center"  width="10%">年龄</th>
						<th class="TblHead" align="center"  width="20%;">专业</th> 
						<th class="TblHead" align="center"  width="20%">职称</th>
						<th class="TblHead" align="center"  width="20%">职责</th>
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td align="center">
							<input type="radio" class="radiobutton" name="awardradio" >
						</td>
						<td align="center">
							<span name="awards|award[0]@seq_no" >[index]</span> 
						</td>
						<td align="center">
							<input name="awards|award[0]|name" label="姓名"   class="required input_css maxlength:50" style="width:80%;" maxlength="50"/>
 						</td>
						<td align="center">
							<input name="awards|award[0]|age" label="年龄"   class="required input_css" style="text-align:right;width:80%;" onfocus="InitInput.setNumber(this,3,0,0)"/>
 						</td>
						<td align="center">
							<input name="awards|award[0]|major_work" label="专业"   class="required input_css maxlength:50" style="width:80%;" maxlength="50"/>
 						</td>
						<td align="center">
							<cpt:tree key="prof_title" cacheable="false" className="" readonly="true" value="" label="职称"  width="150px"
			          		id="prof_title_[index]" name="prof_title" showPattern="all" shieldPattern="0" onClick="initTreeValueExt"/>
				        	<input type="hidden" name="awards|award[0]|prof_title_value" class="required" label="职称" value=""/>
			           		<input type="hidden" name="awards|award[0]|prof_title_name" value=""/>
						</td> 
						<td align="center">
							<input name="awards|award[0]|position" label="职责"   class="required input_css maxlength:100"  style="width:80%;" maxlength="100"/>
						</td> 
					</tr>
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/awards/award" var="award">
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr >
						<td align="center">
								<input type="radio" class="radiobutton" name="awardradio" >
							</td>
							<td align="center">
								<span name="awards/award[${flag}${index}]@seq_no" >
									<x:out select="$award/@seq_no"/>
								</span> 
							</td>
						 <td align="center">
							<input name="awards/award[${flag}${index}]/name" label="姓名"  value="<x:out select="$award/name"/>" class="required input_css maxlength:50" style="width:80%;" maxlength="50"/>
 						</td>
						<td align="center">
							<input name="awards/award[${flag}${index}]/age" label="年龄" value="<x:out select="$award/age"/>"   class="required input_css" style="text-align:right;width:80%;" onfocus="InitInput.setNumber(this,3,0,0)"/>
 						</td>
						<td align="center">
							<input name="awards/award[${flag}${index}]/major_work" label="专业"  value="<x:out select="$award/major_work"/>"  class="required input_css maxlength:50" style="width:80%;" maxlength="50"/>
 						</td>
						<td align="center">
							<c:set var="prof_title">{'id':'<x:out select="$award/prof_title_value" />','name':'<x:out select="$award/prof_title_name" />'}</c:set>
				          	<cpt:tree key="prof_title" cacheable="false" className="" readonly="true" value="${prof_title}" label="职称"  width="150px"
				          		id="prof_title_${flag}${index}" name="prof_title" showPattern="all" shieldPattern="0" onClick="initTreeValueExt"/>
					        <input type="hidden" name="awards/award[${flag}${index}]/prof_title_value" class="required" label="职称" value="<x:out select="$award/prof_title_value" />"/>
				           	<input type="hidden" name="awards/award[${flag}${index}]/prof_title_name" value="<x:out select="$award/prof_title_name" />"/>
						 </td>
						<td align="center">
							<input name="awards/award[${flag}${index}]/position" label="职责"  value="<x:out select="$award/position"/>" class="required input_css  maxlength:100"  style="width:80%;" maxlength="100"/>
						</td> 
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					</tbody>
					</table>
					
					<table width="98%" align="center"  class="tb_button">
						<tr >
							<td>
								<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('awardInfo');try{top.resizeFrame();}catch(e){};">
								<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('awardInfo','awardradio')">
								<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('awardInfo','awardradio')">
								<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('awardInfo','使用维护人员情况')">
							</td>
						</tr>
					</table>	
 <br/>
	  <div class="t_bar"><span class="color_red">*</span>技术负责人简介（限300字）</div>
	 <table class="t_css" width="100%" border="0" cellpadding="0"  id="tblresume"
	    cellspacing="1">
    	<tr>
		<td>
			1．姓名、年龄、学历、职称等；<br/>
			2．主要讲述熟悉、掌握和使用该仪器设备的能力。
		</td>
		</tr>
      <tr class="li_2">
          <td>
			<textarea rows="15" cols="122" style="width: 98%" class="input_textarea required maxlength:300 "   name='proposal/goal/resume'  label="技术负责人简介"><x:out select="$xmlData/data/proposal/goal/resume"/></textarea>
		   <input type='hidden' name='proposal/goal/resume_hidden' id='proposal/goal/resume_hidden' value=''>
		  </td>
      </tr>
      
    </table>	
    
    <script type="text/javascript">
	/**
	* 选择树设置隐藏域值 public.js中原函数不适用，针对treeId中包含下标的情况
	*/
	function initTreeValueExt(treeId, treeNode) {

		var inputId = treeId.substring(0, treeId.lastIndexOf('_'));
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			if (treeNode.level == 0) {
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find("[name$='" + inputId + "_code'],[id$='" + inputId+ "_code']").val("");
				$("#" + treeId).parents("td").find("[name$='" + inputId + "_value'],[id$='" + inputId+ "_value']").val("");
				$("#" + treeId).parents("td").find("[name$='" + inputId + "_name'],[id$='" + inputId+ "_name']").val("");
			}
			return false;
			}
			var str = treeNode.name;
			var obj = treeNode.parentNode;
			while (obj != null) {
				//str = obj.name + "-" + str;
				obj = obj.parentNode;
			}
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_code'],[id$='" + inputId+ "_code']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_value'],[id$='" + inputId+ "_value']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_name'],[id$='" + inputId+ "_name']").val(str);
		}
	</script>